#include <bits/stdc++.h>
using namespace std;
const int N = 1010;

int n, d;
struct node
{
	double l, r;
}a[N];

int main()
{
	int cnt = 1;
	while(cin >> n >> d)
	{
		if(n == 0 && d == 0) break;
		bool flag = false;
		for(int i = 1;i <= n;i ++)
		{
			int x, y; cin >> x >> y;
			if(y > d)
			{
				flag = true;
				break;
			}
			double t = sqrt(d * d - y * y);
			a[i].l = x - t, a[i].r = x + t;
		}
		printf("Case %d: ", cnt ++);
		if(flag) cout << -1 << endl;
		else
		{
			sort(a + 1, a + 1 + n, [](node& n1, node& n2){ return n1.l < n2.l; });
			int ans = 1;
			double e = a[1].r;
			for(int i = 2;i <= n;i ++)
			{
				if(a[i].l <= e) e = min(e, a[i].r);
				else
				{
					ans ++;
					e = a[i].r;
				} 
			}
			cout << ans << endl;
		}
	}
	return 0;
}